function saveQuickLink(form) {
	var params = "method=savequicklink"
			+ '&quickLink1=' + form.quickLink1.value
			+ '&quickLink2=' + form.quickLink2.value
			+ '&quickLink3=' + form.quickLink3.value
			+ '&quickLink4=' + form.quickLink4.value
			+ '&quickLink5=' + form.quickLink5.value
			+ '&quickLink6=' + form.quickLink6.value;
	
	var serverUrl = "../Admin";
	createRequest();
	if(ajaxRequest == null) {
		loadPage('student');
		return false;
	}
	
	ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4 && ajaxRequest.status == 200) {
			refreshQuickLink();
		}
	};
	
	ajaxRequest.open("POST", serverUrl, true);
	ajaxRequest.setRequestHeader("Content-Type" , "application/x-www-form-urlencoded");
	ajaxRequest.send(params);
	return false;
}

/**
Method used to update qucik link.
**/
function refreshQuickLink() {
	var params = "";
	var quickLinkPageName = "quickLink";
	var serverUrl = "../jsp/" + quickLinkPageName + ".jsp";
	createRequest();
	
	if(ajaxRequest == null)
		return;
	
	ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4 && ajaxRequest.status == 200) {
			document.getElementById("quickLinkBar").innerHTML = ajaxRequest.responseText;	   
		}
	};
	ajaxRequest.open("POST", serverUrl, true);
	ajaxRequest.setRequestHeader("Content-Type" , "application/x-www-form-urlencoded");
	ajaxRequest.send(params);
	return false;
}

/**
Method is used to quick link to class
**/
function quickStudentList(classId, className, year) {
	
	var params = "method=verifyquicklink"
			+ '&classId=' + classId;
	
	var serverUrl = "../Admin";
	createRequest();
	if(ajaxRequest == null) {
		return false;
	}
	
	ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4 && ajaxRequest.status == 200) {
			var response = ajaxRequest.responseText;
			if(response != '-1') {
					showStudentList(response);
				
			} else {
				alert("Class " + className + "  not available for " + year +".");
				return false;
			}
		}
	};
	
	ajaxRequest.open("POST", serverUrl, true);
	ajaxRequest.setRequestHeader("Content-Type" , "application/x-www-form-urlencoded");
	ajaxRequest.send(params);
	return false;
}

/**
configure the year
**/
function updateConfiguredYear(form) {
	var params = "method=configureyear"
			+ '&yearConfig=' + document.getElementById("yearConfig").value;
	var serverUrl = "../Admin";
	createRequest();
	if(ajaxRequest == null) {
		return false;
	}
	
	ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4 && ajaxRequest.status == 200) {
			return false;
		}
	};
	
	ajaxRequest.open("POST", serverUrl, true);
	ajaxRequest.setRequestHeader("Content-Type" , "application/x-www-form-urlencoded");
	ajaxRequest.send(params);
	return false;
}